package org.spring.springboot.controller;

import org.spring.springboot.base.AppConstant;
import org.spring.springboot.pojo.RequstData;
import org.spring.springboot.pojo.req.DepartmentParam;
import org.spring.springboot.pojo.resp.Department;
import org.spring.springboot.pojo.resp.Result;
import org.spring.springboot.service.HisInformationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
public class HisInformationController {
    @Autowired
    private HisInformationService hisInformationService;

    @RequestMapping(value = "api/his", method = RequestMethod.POST)
    public base his(@RequestBody DepartmentParam departmentParam) {
       String params = departmentParam.toXML();
        System.out.println("请求的数据"+params);
        //封装请求数据
        RequstData req = new RequstData();
//		自动加密
        req.setDATAPARAM(params);
        req.setSERVICE(AppConstant.Register_Depart_Query);
        Result<Department> result =hisInformationService.request(AppConstant.OutPatient,req);
        base results = new base();
        results.data = result;
        return results;
    }

}
